
<!doctype html>
<html>

<head>
<meta charset="utf-8">
<title>后台管理模板</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta charset="utf-8">
<link rel="stylesheet"
	href="@{'/public/plugins/layui_new/css/layui.css'}" media="all">
<link rel="stylesheet" href="@{'/public/css/sweetalert2.min.css'}">
<link href="@{'public/css/dropzone.min.css'}" rel="stylesheet">
<link href="@{'public/css/dropzone.min.css'}" rel="stylesheet">
<link rel="stylesheet" href="@{'public/css/global.css'}" media="all">
<link rel="stylesheet" href="@{'public/css/style.min.css'}" media="all">

<script src="@{'public/js/jquery-2.1.4.min.js'}"></script>
<script src="@{'public/plugins/layui_new/layui.js'}"></script>


<script src="@{'public/js/sweetalert2.min.js'}"></script>
<script src="@{'public/js/dropzone.min.js'}"></script>
<script src="@{'public/js/clipboard.min.js'}"></script>


</head>
<body>


	<!-- 内容主体区域 -->
	<div style="padding: 15px;">
		<!--公司信息管理管理  -->
		<fieldset class="layui-elem-field">
			<legend>
				公司详细管理<span style="font-size: 9px; color: red;">&nbsp;&nbsp;&nbsp;&nbsp;(&nbsp;建议图片大小《1920*198》)</span>
				<!-- <a href=""  class="layui-btn  upLoad">点击修改logo图片</a> -->
				<!-- 		<a href=""  class="layui-btn  upLoad" name='img'>点击修改公司图片</a> -->
			</legend>
			<div class="layui-field-box layui-form">
				<table class="layui-table admin-table">
					<thead>
						<tr>
							<th>微信二维码</th>
							<th>公司名称</th>
							<th>公司地址</th>
							<th>公司详细<span style="font-size: 9px; color: red;">(段落间用(。)号分割)</span></th>
							<th>公司电话</th>
							<th>公司邮箱</th>
							<th>公司微信</th>
							<th>公司QQ</th>
							<th>公司传真</th>
							<th>操作</th>
						</tr>
					</thead>
					<tbody id="content">
						<tr>

							<td><img
								
								src="${companyInfo.get('companyWximg')}"
								width="50px" height="25px" /></td>

							<td>${companyInfo.get('companyName')}</td>
							<td>${companyInfo.get('companyAddress')}</td>
					
							#{if companyInfo.get('companyDetail').length()>10}
								<td>${companyInfo.get('companyDetail').substring(0,10)}...</td>
							#{/if}
							#{else}
								<td>${companyInfo.get('companyDetail')}</td>
							#{/else}
						
							
							<td>${companyInfo.get('companyTelephone')}</td>
							<td>${companyInfo.get('companyWxName')}</td>
							<td>${companyInfo.get('companyQqName')}</td>
							<td>${companyInfo.get('companyEmail')}</td>
							<td>${companyInfo.get('companyFax')}</td>
							<td><a href="javascript:companyUpShow()"
								class="layui-btn layui-btn-normal layui-btn-mini">修改</a></td>

						</tr>
					</tbody>
				</table>
			</div>
		</fieldset>
		<!--首页轮播管理  -->
		<fieldset class="layui-elem-field">
			<legend>
				首页轮播管理<span style="font-size: 9px; color: red;">&nbsp;&nbsp;&nbsp;&nbsp;(&nbsp;建议图片大小《1920*798》)</span>
			</legend>
			<div class="layui-field-box layui-form">
				<table class="layui-table admin-table">
					<thead>
						<tr>

							
							#{list LunBOInfo , as:'peo'}
								<th>${peo.key}</th>
							#{/list}
							
							
							<th>添加图片</th>
						</tr>
					</thead>
					<tr>
						#{list LunBOInfo , as:'peo'}
						<td><img
								alt="" src="${img_path}${peo.value}"
								width="100px" height="65px"></td> 
						#{/list}

						<td width="60">
						<a href="javascript:imgsUpShow()"><i class="layui-icon upLoad" style="font-size: 50px; color: #FF5722;">&#xe61f;</i></a>
						</td>
					</tr>
		
				</table>
			</div>
		</fieldset>


		<!--公司优势信息管理  -->
		<fieldset class="layui-elem-field">
			<legend>
				品牌优势信息管理
				<button
					class="layui-btn layui-btn-small layui-btn-radius layui-btn-danger"
					onclick="updateDataShow(-1)">
					<i class="layui-icon">&#xe608;</i> 添加&nbsp;&nbsp;
				</button>
			</legend>
			<div class="layui-field-box layui-form">

				<table class="layui-table admin-table">
					<thead>
						<tr>
							<th>标题</th>
							<th>内容</th>
							<th>图片</th>
							<th>操作</th>
						</tr>
					</thead>
					<tbody id="content">
						
						
						#{list result, as:'item'}
						<tr>
						<th>${item.title}</th>
						#{if item.msg.length()>10}
						<th>${item.msg.substring(0,10)}...</th>
						#{/if}
						#{else}
						<th>${item.msg}</th>
						#{/else}
						<th><img src="${item.img}" height="25px" width="50px"></img></th>
						
					
						<td><a onclick="updateDataShow(${item.id})" target="_blank"
								class="layui-btn layui-btn-normal layui-btn-mini">修改</a> <a
								href="javascript:deleteById(${item.id})"
								class="layui-btn layui-btn-mini layui-btn-warm">删除</a></td>
						</tr>
						#{/list}
					</tbody>
				</table>
			</div>
		</fieldset>
	</div>


	<script>
	 
	 	 layui.use('element', function(){
		  var element = layui.element;
		  
		}); 
		layui.use(['layer', 'form'], function(){
			  var layer = layui.layer
			  ,form = layui.form;
			  
		});
		
		layui.use('table', function(){
		  var table = layui.table;
		  
		});

		function updateDataShow(id){
			
			window.location.href="@{manage.addOrUpIntroduces()}?id="+id;
			
			
		}
		
		//
		function deleteById(id) {
			layer.confirm(
							'确认删除吗？',
							{
								btn : [ '确定', '关闭' ]
							},
							function() {
								$.ajax({url : "@{manage.deleteIntrById()}",
										type : "GET",
										async : false,
										data : {
											"id" : id
										},
										dataType : "text",
										success : function(data) {
												if (data) {
													
													window.location.href="@{manage.companyManage()}";
													
												} else {
													layer.alert("删除失败!");
												}
											},
											error : function(data) {
												layer.alert("您的账户可能出现异常，请重新刷新获取账号信息!");
											}
										})
							});
		}
		
		
	//JavaScript代码区域
		var map={};
		function test(){
			for(var key in map)  {
				alert("属性：" + key + ",值："+ map[key]);
			}  
		}
		
	//轮播 拖动上传图片
		function dynamicOp(){
			layer.open({
      		  type: 2,
      		  area: ['700px', '450px'],
      		  fixed: false, //不固定
      		  maxmin: true,
      		  content: '@{manage.upFileT()}'
      		});
	  	} 
	//显示公司信息修改窗体
		function companyUpShow(){
			layer.open({
				  type: 1,
				  title: "公司信息",
				  content: $('.edit-CompanyUpShow'),
				  area: ["900","900"]
				});	
			
		}
		
	
		//显示轮播图片修改窗体
		function imgsUpShow(){
			
			layer.open({
      		  type: 2,
      		  area: ['700px', '450px'],
      		  fixed: false, //不固定
      		  maxmin: true,
      		  content: '/upFileT?maxIndex='+6,	
      		  end: function(){ 
      			  

					var mapstr = "{";
					
					for(var i in map){
						
						mapstr = mapstr + '"' +map[i]+'":"'+i+'",'
		
					}
					
					mapstr+="}"
					
      			  
      			  
      			$.ajax({
				 	url: "@{manage.LUNBOAddOrUp()}",
					type: "GET",
					async:false,
					data:{"index":mapstr},
					dataType: "text",
					success: function(data) {
						
						
						if(data){
							 layer.confirm('修改成功！</br>', {
							        btnAlign: 'c',
							        btn: ['确定']
						      },function()
							      {window.location.href="/manageCompanyManage";}
						      ); 
						}else{
							layer.alert("失败!");
						}
					},
					error: function(data) {
						layer.alert("您的账户可能出现异常，请重新刷新获取账号信息!");
					}
					
					
		  		});

      		  }
			
			});
      		
			
		}
		
		
	 	//公司信息修改
		function companyUp(){
		
			 var data=$("#companyShowID").serialize();
			 $.ajax({
				 	url: "@{manage.companyUp()}",
					type: "GET",
					async:false,
					data:data,
					dataType: "text",
					success: function(data) {
						if(data){
							 layer.confirm('修改成功！</br>', {
							        btnAlign: 'c',
							        btn: ['确定']
						      },function()
							      {window.location.href="/manageCompanyManage";}
						      ); 
						}else{
							layer.alert("失败!");
						}
					},
					error: function(data) {
						layer.alert("您的账户可能出现异常，请重新刷新获取账号信息!");
					}
		  	}) 
		  	
		  	
		  	
		  	
		}
		
	
		
	
	//替换图片
	function upLoadImg(index){
        	
        	layer.open({
        		  type: 2,
        		  area: ['700px', '450px'],
        		  fixed: false, //不固定
        		  maxmin: true,
        		  content: '/upFileT?maxIndex='+1,	
        		  end: function(){ 
					
        			  for(var i in map){
        				 if(index==1){
	        				  $("#logoImg img").remove()
	               			  $("#logoImg input").val("");
	        				  $("#logoImg input").val(i);
	        				  var img ='<img src="${img_path}'+i+'" height="25px" width="50px"></img>';
	        				  $("#logoImg").append(img);
        				  
        			 	 }else if(index==2){
        			 		
        			 		$("#companyImg img").remove()
	               			  $("#companyImg input").val("");
	        				  $("#companyImg input").val(i);
	        				  var img ='<img src="${img_path}'+i+'" height="25px" width="50px"></img>';
	        				  $("#companyImg").append(img);
        			 		 
        			 	 }
        				  
        				  
        			  }
        			  
        			  
					
        			  
        		  }
        		});
        }
	
	
		//关闭弹窗
		function  close(){
			layer.closeAll()	
		}
	</script>
	<!--图片展示  -->
	<div class="imgShow" hidden="hidden"">
		<img id="imgId" alt="" src="" width="300px" height="200px">
	</div>




	<!-- 公司信息修改 -->
	<div class="edit-CompanyUpShow" hidden="hidden"
		style="padding: 17px 0 20px 30px;">
		<form class="layui-form" action="" id="companyShowID">



			<div class="layui-form-item layui-block">
				<label class="layui-form-label">修改微信二维码</label>
				<div class="layui-input-inline" id="logoImg">
					<a href="javascript:upLoadImg(1)" class="layui-btn layui-btn-small">选择</a>
					<input name="logoimg"  type="hidden"/>
				</div>
			</div>

			<!-- <div class="layui-form-item layui-block">
				<label class="layui-form-label">修改公司图片</label>
				<div class="layui-input-inline" id="companyImg">
					<a href="javascript:upLoadImg(2)" class="layui-btn layui-btn-small">选择</a>
					<input name="comimg"  type="hidden"/>
				</div>
			</div> -->


			<div class="layui-form-item layui-block">
				<label class="layui-form-label">公司名称</label>
				<div class="layui-input-inline">
					<input type="text" name="companyName" required
						lay-verify="required" placeholder="必填项" class="layui-input">
				</div>
			</div>
			<div class="layui-form-item layui-block">
				<label class="layui-form-label">公司详细</label>
				<div class="layui-input-inline">
					<textarea placeholder="请输入内容" class="layui-textarea"  name="companyDetail" required
					 placeholder="必填项" ></textarea>
				</div>
			</div>
			<div class="layui-form-item layui-block">
				<label class="layui-form-label">公司电话</label>
				<div class="layui-input-inline">
					<input type="text" name="companyTelephone" required
						lay-verify="required" placeholder="必填项" class="layui-input">
				</div>
			</div>
			<div class="layui-form-item layui-block">
				<label class="layui-form-label">公司邮箱</label>
				<div class="layui-input-inline">
					<input type="text" name="companyEmail" required
						lay-verify="required" placeholder="必填项" class="layui-input">
				</div>
			</div>
			<div class="operate-btn" style="text-align: center;">
				<a href="javascript:companyUp()" class="layui-btn layui-btn-small">确认</a>
				<a href="javascript:close()"
					class="layui-btn layui-btn-primary layui-btn-small">取消</a>
			</div>
		</form>
	</div>
	
	
	<!-- 公司信息修改 -->
	<div class="edit-imgs" hidden="hidden" style="padding: 17px 0 20px 30px;">
		
		<form class="layui-form" action="" id="imgsShowID">


			<div class="layui-form-item layui-block">
				<label class="layui-form-label">图片一</label>
				<div class="layui-input-inline" >
					<a href="javascript:upLoadImg(3)" class="layui-btn layui-btn-small">选择</a>
					<input name="imgs_01"  type="hidden"/>
				</div>
			</div>


		</form>
	</div>


</body>
</html>
